#include <iostream>
using namespace std;
using ll= long long;
int main()
{
  ll a = 7385137888721;
  ll b = 10470245;
  b /= 4;
  a += b;
  ll i = 1; 
  for(; true;i++){
    if(i * i > a){
      break;
    }
  }
  cout << (i - 1) * 2 << endl;
  return 0;
}

#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
  cout << 9 << endl;
  return 0;
}

#include <iostream>
using namespace std;
using ll = long long;
int main()
{
  ll ans = 0,n = 0,t = 0;
  cin>>n;
  ans = n;
  while(n--){
    cin>>t;
    if(t % 2 == 1){
      ans--;
      continue;
    }
    ll cnt1 = 2,cnt2 = 1;
    while(cnt2 <= t){
      if((t - cnt2) % cnt1 == 0){
        ans--;
        cout << cnt1 << ' ' << cnt2 << endl;
        break;
      }
      cnt2 += cnt1;
      cnt1++;
    }
  }
  cout << ans << endl;
  return 0;
}
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
using ll = long long;
// ll num[200005][2];
int arr[] = { 1,0,0,0,1,0,1,0,2,1 };
ll fun(ll a) {
	int ans = 0;
	while (a != 0) {
		int b = a % 10;
		a /= 10;
		ans += arr[b];
	}
	return ans;
}
vector<vector<ll>> num(200005, vector<ll>(2));
/*bool com(ll a[2], ll b[2]) {
	if (a[0] == b[0]) return a[1] > b[1];
	return a[0] > b[0];
}*/
bool com(vector<ll>&a, vector<ll> b) {
	if (a[0] == b[0]) return a[1] < b[1];
	return a[0] < b[0];
}
int main()
{
	int n;  cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> num[i][1];
		num[i][0] = fun(num[i][1]);
	}
	sort(num.begin(), num.begin() + n, com);
	for (int i = 0; i < n; i++) {
		cout << num[i][1] << ' ';
	}
	return 0;
}


#include <iostream>
using namespace std;
int arr[100005];
int main()
{
  int n;  cin>>n;
  int left = 0,right = n - 1;
  for(int i = 0;i < n;i++)  cin>> arr[i];
  long long ans = 0;
  while(left < right){
    if(arr[left] == arr[right]) 
    {
      left++,right--;
    }else{
      int a = arr[right] - arr[left];
      ans += abs(a);
      arr[left] = arr[right];

      if(right - left > 2){
        // if(arr[left + 1] > arr[right - 1]){
        //   swap(arr[left + 1],arr[right - 1]);
        // }
        int &x = arr[left + 1],&y = arr[right - 1]; 
        if(x < y && a > 0) x = min(x + a,y);
        if(x > y && a < 0) x = max(x + a,y);
      }
    }
  }
  cout << ans << endl;
  return 0;
}
#include <iostream>
using namespace std;
int cnt[300005];
int l[300005];
int r[300005];
int sum[300005];
int main()
{
  int n,m;  cin>>n>>m;
  for(int i = 0;i < m;i++){
    cin >> l[i] >> r[i];
    cnt[l[i]]++;
    cnt[r[i] + 1]--;
  }
  int a = 0,b = 0;
  for(int i = 1;i <= n;i++){
    a += cnt[i];
    // cout << a  << ' ';
    sum[i] = a;
    if(a == 0) b++;
  }
  // cout<< endl;
  for(int j = 0;j < m;j++){
    int ans = 0;
    for(int i = l[j];i <= r[j];i++){
      if(sum[i] == 1){
        ans++;
      }
    }
    cout << ans + b<< endl;
  }
  return 0;
}
#include <iostream>
#include <algorithm>
using namespace std;
int arr[100005];
int main()
{
  int n,m;  cin>>n>>m;
  for(int i = 1;i <= n;i++){
    cin>>arr[i];
  }
  sort(arr + 1,arr + n + 1);
  int left = 1,right = 1;
  int ans = 0;
  while(left <= n){
    if(abs(arr[left]) > m){
      left++;
      continue;
    }
    right = max(right,left);
    int len = min(abs(arr[left]),abs(arr[right])) + arr[right] - arr[left];
    while(right <= n && len <= m){
      right++;
      ans = max(ans,right - left);
      len = min(abs(arr[left]),abs(arr[right])) + arr[right] - arr[left];
    }
    // cout << arr[left] <<' ' << arr[right] << endl;
    left++;
  }
  cout << ans << endl;
  return 0;
}

#include <iostream>
#include <string>
using namespace std;
int main()
{
  int t;  cin>>t;
  string str;
  while(t--){
    cin >> str;
    int n = str.size() - 1;
    auto check = [&](int nn){
      int l = 0,r = nn;
      while(l < r){
        if(str[l] != str[r]) return false;
        l++,r--;
      }
      return true;
    };
    while(n >= 0){
      if(check(n)){
        cout << "Yes" << endl;
        break;
      }
      if(str[n] != 'l' &&str[n] != 'q'&&str[n] != 'b'){
        cout << "No" << endl;
        break;
      }
      n--;
    }
  }
  return 0;
}